<template>
  <div class="midWrap" id="mid">
    <p>{{ msg }}</p>
    <button @click="search">换一句</button>
  </div>
</template>

<script>
// import { shici } from "../../../js/shici";
// shici((data) => {
//   console.log(data);
// });
export default {
  data() {
    return {
      msg: "加载中。。。",
    };
  },
  mounted() {
    this.search();
  },
  methods: {
    search() {
      $.ajax({
        url: "https://api.muxiaoguo.cn/api/Gushici	",
        method: "GET",
        data: {
          api_key: "7dbb5e588a749d24",
        },
      }).then((data) => {
        console.log(data.data.min_content);
        this.$data.msg = data.data.min_content;
      });
    },
  },
};
</script>

<style lang="scss">
.midWrap {
  width: 100%;
  height: 200px;
  padding-top: 50px;
  text-align: center;
  > p {
    font-size: 36px;
  }
  > button {
    border: 0;
    outline: none;
    color: #fff;
    background-color: #28a745;
    width: 70px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    margin-top: 50px;
  }
}
</style>